package com.zhanglijie.theory.readwrite;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/8/14 0014 16:18
 */
public class ReadThread extends Thread{
    private final TextData textData;
    public ReadThread(String name,TextData textData){
        super(name);
        this.textData = textData;
    }

    @Override
    public void run() {
        while (true){
            try {
                char[] read = textData.read();
                System.out.println(Thread.currentThread()
                    .getName() + "读取了===" +String.valueOf(read));
            }catch (Exception e){}
        }
    }
}
